{{>header}}

{{#equals @root.httpClient 'angular'}}
import { Inject, Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import type { Observable } from 'rxjs';

import type { ApiRequestOptions } from './ApiRequestOptions';
import { BaseHttpRequest } from './BaseHttpRequest';
import type { OpenAPIConfig } from './OpenAPI';
import { OpenAPI } from './OpenAPI';
import { request as __request } from './request';
{{else}}
import type { ApiRequestOptions } from './ApiRequestOptions';
import { BaseHttpRequest } from './BaseHttpRequest';
import type { CancelablePromise } from './CancelablePromise';
import type { OpenAPIConfig } from './OpenAPI';
import { request as __request } from './request';
{{/equals}}

{{#equals @root.httpClient 'angular'}}
@Injectable()
{{/equals}}
export class {{httpRequest}} extends BaseHttpRequest {

	{{#equals @root.httpClient 'angular'}}
	constructor(
		@Inject(OpenAPI)
		config: OpenAPIConfig,
		http: HttpClient,
	) {
		super(config, http);
	}
	{{else}}
	constructor(config: OpenAPIConfig) {
		super(config);
	}
	{{/equals}}

	{{#equals @root.httpClient 'angular'}}
	/**
	 * Request method
	 * @param options The request options from the service
	 * @returns Observable<T>
	 * @throws ApiError
	 */
	public override request<T>(options: ApiRequestOptions): Observable<T> {
		return __request(this.config, this.http, options);
	}
	{{else}}
	/**
	 * Request method
	 * @param options The request options from the service
	 * @returns CancelablePromise<T>
	 * @throws ApiError
	 */
	public override request<T>(options: ApiRequestOptions): CancelablePromise<T> {
		return __request(this.config, options);
	}
	{{/equals}}
}
